
Type MaterialManager	
	Function Create:Material(matName:String, group:String)
		Local mat:Material	= New Material
		mat._materialName	= matName
		
		Return mat
	End Function
	
	Function getByName:Material(matName:String)
		Local p:Byte ptr = o_material_getByName(matName.ToCString())
		Local mat:Material = Null
		Local found:Byte = False
		
		If Material._materials <> Null
			For Local i:Material = EachIn Material._materials
				If i._ptr = p
					found = True
					mat = i
					Exit
				End If
			Next
		Else
			mat = New Material
			mat._ptr = p
			mat._typ = ET_NO_ENTITY
		End If
		
		return mat
	End Function
End Type